# -*- coding: utf-8 -*-
# @Time    : 2021/9/16 12:39
# @Author  : BrandonGT
# @FileName: 10_6_addition.py

def add_two_num():
    welcome_msg = "This program will add two number and return the result"
    exit_msg = "Enter 'q' at any time to exit"
    prompt_01 = "Enter first number: "
    prompt_02 = "Enter second number: "

    while True:
        num01 = input(prompt_01)
        if num01 == 'q':
            break
        num02 = input(prompt_02)
        if num02 == "q":
            break

        try:
            num01 = int(num01)
            num02 = int(num02)
        except ValueError:
            print("Sorry, please enter numerical input")
        else:
            result = num01 + num02
            print(f"{num01} + {num02} = {result}")


add_two_num()